﻿using MyHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    public class IdHelper
    {
        public static string StringID
        {
            get
            {
                int mid = new Random().Next(20);                
                if(App.initConfig != null) mid = App.initConfig.machineId;
                var id = Snowflake.Instance(mid).GetId().ToString();
                return id.Substring(0,id.Length -3);
            }
        }
        public static long LongID
        {
            get
            {
                var id = StringID;
                return long.Parse(id) / 1000;
            }
        }
    }
}
